package edu.sjtu.grid.workflow.group;

import java.util.ArrayList;
import java.util.List;

public class GroupMappingIterator {
	
	private List<GroupMapping> groupMappingList = null;
	private int i = 0;
	
	public GroupMappingIterator(List<GroupMapping> sortedGroupMappingList)
	{
		this.groupMappingList = (sortedGroupMappingList == null ? 
				new ArrayList<GroupMapping>(): sortedGroupMappingList);
		this.i = 0;
		//Collections.sort(this.groupMappingList, new GroupMappingComparator());
	}
	
	public boolean hasNext()
	{
		return this.i < this.groupMappingList.size();
	}
	
	public GroupMapping next()
	{
		if(!this.hasNext())
			return null;
		return this.groupMappingList.get(i++);
	}

	
}
